<?php
	$school = $_SESSION['school'];
?>
<script type="text/javascript" src="js/class.js"></script>
<input type="hidden" id="schoolid" value="<?php echo $school->getId(); ?>" />
<input type="hidden" id="facultyid" value="<?php echo $_SESSION['facultyid']; ?>" />
<input type="hidden" id="departmentid" value="<?php echo $_SESSION['departmentid']; ?>" />
<input type="hidden" id="subjectid" value="<?php echo $clazz->getSubjectid(); ?>" />
<input type="hidden" id="classid" value="<?php echo $clazz->getId(); ?>" />
<input type="hidden" id="semesterid" value="<?php echo $clazz->getSemesterid(); ?>" />
<!-- Must have page id (for notice use) -->
<input type="hidden" id="pageid" value="5" />
<!-- Must have reference id (for notice use) -->
<input type="hidden" id="referenceid" value="<?php echo $clazz->getId(); ?>" />
<div class="ui-corner-all"><?php include "view/topmenu.php"; ?></div>
<div class="block">
	Welcome <?php 
		if(!empty($_SESSION['user'])){
			$user = $_SESSION['user'];
			echo $user->getName();
		}
	?> :
	<a href="javascript:void(0)" id="linkHome">Home</a> &gt;
	<a href="javascript:void(0)" id="linkFaculty">Faculty</a> &gt;
	<a href="javascript:void(0)" id="linkDepartment">Department</a> &gt;
	<a href="javascript:void(0)" id="linkSubjct">Subject</a> &gt;
	<b>Class</b>
</div>
<div class="block">
	<!-- Class -->
	<fieldset>
		<!-- legend id="classname">Class</legend -->
		<b>Description:</b> <span id="spnClassDesc" name="spnClassDesc"><?php echo $clazz->getDescription(); ?></span><br>
		<b>Lecturer: </b> <span id="spnLecturer"><?php echo $clazz->getPicname();  ?></span><br>
		<b>Vanue: </b> <span id="spnVanue"><?php echo $clazz->getTimetable()->getLocation(); ?></span><br>
		<b>Time: </b> 
		<span id="spnWeekday"><?php HTMLUtil::WeekdayWord( $clazz->getTimetable()->getWeekday() ); ?></span>, 
		<span id="spnTime"><?php echo $clazz->getTimetable()->getStarttime(); ?> to 
		<?php echo $clazz->getTimetable()->getEndtime(); ?></span><br>
		<input type="hidden" id="hidweekdayid" value="<?php echo $clazz->getTimetable()->getWeekday(); ?>" />
		<?php HTMLUtil::EditButton("editClassDesc");  ?>
		<br/>
	</fieldset>
	<!-- Notice -->
	<?php include_once "view/view_ext_notice.php";	?>
	<!-- Feedback -->
	<?php include_once "view/view_ext_feedback.php";	?>
	<!-- Classs !!! NEED REQRITE, USE <TABLE> !!! -->
	
	<!-------------------------------------- Diaologs ---------------------------------->
	
	<div id="dialog_edit_class" title="Edit Class">
		<fieldset>
			Lecturer: <select id="lecturer"></select><br>
			Description: <br>
			<textarea id="class_description" name="class_description" cols="50" rows="4" 
				class="text ui-widget ui-corner-all"></textarea>
			Timetable: <br><select id="weekday"></select><br>
			<select id="fromhour"></select>:<select id="fromminutes"></select><select id="fromampm"></select> to
			<select id="tohour"></select>:<select id="tominutes"></select><select id="toampm"></select><br>
			Vanue: <input type="text" id="location" class="text ui-widget-content ui-corner-all"
				value="<?php echo $clazz->getTimetable()->getLocation(); ?>" />
		</fieldset>
	</div>
	
</div>